package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ResultDataMapper;
import com.ruoyi.system.domain.ResultData;
import com.ruoyi.system.service.IResultDataService;
import com.ruoyi.common.support.Convert;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;


/**
 * 拧紧数据 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-22
 */
@Service
public class ResultDataServiceImpl implements IResultDataService 
{
	@Autowired
	private ResultDataMapper resultDataMapper;

	/**
     * 查询拧紧数据信息
     * 
     * @param id 拧紧数据ID
     * @return 拧紧数据信息
     */
    @Override
    @DataSource(value = DataSourceType.SLAVE)
	public ResultData selectResultDataById(String id)
	{
	    return resultDataMapper.selectResultDataById(id);
	}
	
	/**
     * 查询拧紧数据列表
     * 
     * @param resultData 拧紧数据信息
     * @return 拧紧数据集合
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public List<ResultData> selectResultDataList(ResultData resultData)
	{
	    return resultDataMapper.selectResultDataList(resultData);
	}
	
    /**
     * 新增拧紧数据
     * 
     * @param resultData 拧紧数据信息
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int insertResultData(ResultData resultData)
	{
	    return resultDataMapper.insertResultData(resultData);
	}
	
	/**
     * 修改拧紧数据
     * 
     * @param resultData 拧紧数据信息
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int updateResultData(ResultData resultData)
	{
	    return resultDataMapper.updateResultData(resultData);
	}

	/**
     * 删除拧紧数据对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int deleteResultDataByIds(String ids)
	{
		return resultDataMapper.deleteResultDataByIds(Convert.toStrArray(ids));
	}
	
}
